namespace NetFx.MSIL
{
  using System;
  using System.Collections.Generic;
  using System.Text;
  using System.Reflection;
  using System.Reflection.Emit;

  public enum LocalVariableConstrains
  {
    Unknown = 0x00,
    Pinned = 0x45,
  }

  public class LocalVariableSignature : Signature
  {
    #region Statics
    public static LocalVariableSignature of(bool isByRef, TypeSignature type, List<LocalVariableConstrains> constrains,List<CustomModifierSignature> modifiers)
    {
      return new LocalVariableSignature(isByRef, type, constrains,modifiers);
    }
    #endregion
    #region Fields
    protected bool isByRef = false;
    protected TypeSignature type = null;
    protected List<LocalVariableConstrains> constrains = null;
    protected List<CustomModifierSignature> modifiers = null;
    #endregion
    #region Properties
    public virtual TypeSignature Type
    {
      get
      {
        return this.type;
      }
    }
    public virtual bool IsByRef
    {
      get
      {
        return this.isByRef;
      }
    }
    public virtual List<LocalVariableConstrains> Constrains
    {
      get
      {
        return this.constrains;
      }
    }
    public virtual List<CustomModifierSignature> Modifiers
    {
      get
      {
        return this.modifiers;
      }
    }
    #endregion
    #region Constructors
    public LocalVariableSignature(bool isByRef, TypeSignature type, List<LocalVariableConstrains> constrains,List<CustomModifierSignature> modifiers)
    {
      this.isByRef = isByRef;
      this.type = type;
      this.constrains = constrains;
      this.modifiers = modifiers;
    }
    #endregion
  }

  public class LocalsSignature :Signature
  {
    #region Statics
    public static LocalsSignature of(List<LocalVariableSignature> locals)
    {
      return new LocalsSignature(locals);
    }
    #endregion
    #region Fields
    protected List<LocalVariableSignature> locals = null;
    #endregion
    #region Properties
    public virtual List<LocalVariableSignature> Locals
    {
      get
      {
        return this.locals;
      }
    }
    #endregion
    #region Constructors
    public LocalsSignature(List<LocalVariableSignature> locals)
    {
      this.locals = locals;
    }
    #endregion
  }
}
